package mission2.model;

import java.util.ArrayList;
import java.util.Iterator;

import mission2.model.TestFileIO;

public class TestFileIO {
	
	public static void TestFileIORead() {
		String path = "expressions.txt";
		System.out.println("Fichier de test pour lecture : " + path);
		
		FileIO fileIO = new FileIO(path);
		Iterator<String> it = fileIO.read();
		
		int i = 0;
		while(it.hasNext()) {
			String e = it.next();
			System.out.println("Cellule " + i + " : " + e);
			
			i++;
		}
	}
	
	public static void TestFileIOWrite() {
		String path = "expressionsOutput.txt";
		System.out.println("Fichier de test pour ecriture : "+ path);
		
		FileIO fileIO = new FileIO(path);
		
		ArrayList<String> lineList = new ArrayList<String>();
		lineList.add("Ligne 1");
		lineList.add("Ligne 2");
		lineList.add("Ligne 3");
		lineList.add("Ligne 4");
		lineList.add("Ligne 5");
		
		fileIO.write(lineList);
	}
}